package com.lc.projects.thread;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class Thread1 {
	public static void main(String[] args) throws ParseException {
		final Thread t1 = new Thread(new Runnable() {

			@Override
			public void run() {
				System.out.println("t1");
			}
		});
		
		final Thread t2 = new Thread(new Runnable() {

			@Override
			public void run() {
				try {
					t1.join();
					System.out.println("t2");
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		});
		
		Thread t3 = new Thread(new Runnable() {

			@Override
			public void run() {
				try {
					t2.join();
					System.out.println("t3");
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				
			}
		});
		
		t3.start();
		t2.start();
		t1.start();
		
	}
}
